package com.uzai.console.web.wechatprivate;

import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.github.xiaoymin.knife4j.annotations.ApiSort;
import com.uzai.console.annotation.SystemLogType;
import com.uzai.console.dto.wechatprivate.wxq.wxgroupblacklist.blacklistpub.WxqBlacklistPubIdDto;
import com.uzai.console.dto.wechatprivate.wxq.wxgroupblacklist.blacklistpub.WxqBlacklistPubQuery;
import com.uzai.console.enums.OperationTypeEnum;
import com.uzai.console.enums.SystemModelEnum;
import com.uzai.console.service.wechatprivate.WxqBlacklistPubService;
import com.uzai.console.vo.wechatprivate.wxq.wxgroupblacklist.blacklistpub.WxqBlacklistPubVo;
import com.uzai.console.web.BaseController;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

/**
 * 社群全网黑名单
 * @author liuqi
 * @date 2021年08月16日 15:11
 */
@Api(value = "社群全网黑名单",tags = "个人微信|社群黑名单|社群全网黑名单")
@ApiSort(5)
@RestController
public class WxqBlacklistPubController extends BaseController {
    private Logger logger = LoggerFactory.getLogger(WxqBlacklistPubController.class);

    @Autowired
    private WxqBlacklistPubService wxqBlacklistPubService;

    @ApiOperation(value = "分页查询社群全网黑名单列表", notes = "分页查询社群全网黑名单列表", response = WxqBlacklistPubVo.class)
    @ApiOperationSupport(order = 1)
    @PostMapping("/wxqBlacklistPub/findWxqBlacklistPubList")
    public Object findWxqBlacklistPubList(@RequestBody WxqBlacklistPubQuery wxqBlacklistPubQuery){
        return wxqBlacklistPubService.findWxqBlacklistPubList(wxqBlacklistPubQuery);
    }

    @SystemLogType(model = SystemModelEnum.WxqBlacklistPub, type = OperationTypeEnum.ADD)
    @ApiOperation(value = "加入社群白名单", notes = "加入社群白名单")
    @ApiOperationSupport(order = 2)
    @PostMapping("/wxqBlacklistPub/addWxqBlacklistPubWhite")
    public Object addWxqBlacklistPubWhite(@RequestBody WxqBlacklistPubIdDto wxqBlacklistPubIdDto){
        wxqBlacklistPubService.addWxqBlacklistPubWhite(wxqBlacklistPubIdDto);
        return true;
    }

    @SystemLogType(model = SystemModelEnum.WxqBlacklistPub, type = OperationTypeEnum.DELETE)
    @ApiOperation(value = "取消社群白名单", notes = "取消社群白名单")
    @ApiOperationSupport(order = 3)
    @PostMapping("/wxqBlacklistPub/deleteWxqBlacklistPubWhite")
    public Object deleteWxqBlacklistPubWhite(@RequestBody WxqBlacklistPubIdDto wxqBlacklistPubIdDto){
        wxqBlacklistPubService.deleteWxqBlacklistPubWhite(wxqBlacklistPubIdDto);
        return true;
    }
}
